package com.lpz.ui;

import com.lpz.factory.BeanFactory;
import com.lpz.service.IAccountService;
import com.lpz.service.impl.AccountServiceImple;

public class client {
    public static void main(String[] args) {
        //IAccountService service=new AccountServiceImple();
        //去掉new关键字之后利用工厂模式进行解耦，去调用service层。用工厂的getbean方法，给传参为properties定义的内容
        for (int i = 0; i < 5; i++) {
            IAccountService service= (IAccountService)BeanFactory.getBean("accountService");
            System.out.println(service);
            service.saveAccount();
        }
        }
    }

